Conditions | 1 |
Paths | 1 |
Total Lines | 31 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /** |
||
40 | jQuery( '.select2-terms' ).change(function(){ |
||
41 | jQuery( '.select2-term-meta' ).select2( { |
||
42 | ajax: { |
||
43 | url: ajaxurl, |
||
44 | dataType: 'json', |
||
45 | delay: 250, |
||
46 | data: function () { |
||
47 | return { |
||
48 | term_id: jQuery('.select2-terms').val(), |
||
49 | action: 'bd_load_taxonomy_term_meta' |
||
50 | }; |
||
51 | }, |
||
52 | processResults: function ( data ) { |
||
53 | var options = []; |
||
54 | |||
55 | if ( data ) { |
||
56 | jQuery.each( data, function ( index, dataPair ) { |
||
57 | options.push( { id: dataPair[ 0 ], text: dataPair[ 0 ] } ); |
||
58 | } ); |
||
59 | } |
||
60 | |||
61 | return { |
||
62 | results: options |
||
63 | }; |
||
64 | }, |
||
65 | cache: true |
||
66 | }, |
||
67 | minimumInputLength: 2, // the minimum of symbols to input before perform a search |
||
68 | width: '300px' |
||
69 | } ); |
||
70 | }); |
||
71 | |||
72 | } ); |